package duaxe.home.entity.particle;

import java.util.ArrayList;
import java.util.List;

import duaxe.home.Graphics.Screen;
import duaxe.home.Graphics.Sprite;
import duaxe.home.entity.Entity;

public class Particle extends Entity {
	//dan
	private List<Particle> particles = new ArrayList<Particle>();
	
	private Sprite sprite;
	private int life;
	
	protected double xx,yy, xa, ya;
	
	
	public Particle(int x, int y, int xa, int ya) {
		//createParticle( x, y, life);
		this.x = x;
		this.y = y;
		this.xx=x;
		this.yy=y;
		this.life = life;
		sprite = Sprite.particle_nomal;
		this.xa = random.nextGaussian();
		this.ya = random.nextGaussian();

	}
//	public Particle(int x, int y, int life,int amount) {
//		this( x, y, life);
//		for(int i=0; i< amount-1; i++){
//			particles.add(new Particle(x, y, life));
//		}
//		particles.add(this);
//
//	}
	public void update(){
		this.xx += xa;
		this.yy += ya;
	}
	public void render(Screen screen){
		screen.renderSprite((int)xx,(int)yy, sprite, true);
		
	}
}
